package com.study.forumsystemproject.exception;

import com.study.forumsystemproject.common.Result;
import lombok.Getter;

/**
 * program: forum-system-project
 * <p>
 * description: 自定义异常信息
 * <p>
 * author: xiaoxie
 * <p>
 * create: 2024-08-14 20:42
 **/
@Getter
public class ApplicationException extends RuntimeException {
    protected Result errorResult;
    /** 返回自定义状态码的异常信息
     * Description: ApplicationException
     * Param: * @param errorResult
     * Author: xiaoxie
     * Date: 20:47 2024/8/14
    */
    public ApplicationException(Result errorResult) {
        super(errorResult.getMsg());
        this.errorResult = errorResult;
    }
    /** 指定异常和描述
     * Description: ApplicationException
     * Param: * @param message
     * @param cause
     * Author: xiaoxie
     * Date: 20:48 2024/8/14
    */
    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    /** 指定异常描述
     * Description: ApplicationException
     * Param: * @param message
     * Author: xiaoxie
     * Date: 20:48 2024/8/14
    */
    public ApplicationException(String message) {
        super(message);
    }
    /** 指定异常
     * Description: ApplicationException
     * Param: * @param cause
     * Author: xiaoxie
     * Date: 20:49 2024/8/14
    */
    public ApplicationException(Throwable cause) {
        super(cause);
    }
}
